//
//  UIImage+TYZAdd.h
//  DrivieSchoolStudents
//
//  Created by TangBin on 2019/6/4.
//  Copyright © 2019 班文政. All rights reserved.
//

#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN

@interface UIImage (TYZAdd)

- (NSData *)compressWithImage;

/**
 高斯模糊
 
 @param blur 模糊度
 
 @return 处理后的图片
 */
//- (UIImage *)gaussianBlur:(CGFloat)blur;

/**
 设置图片的透明度
 
 @param alpha 0.0~1.0
 @return return value description
 */
- (UIImage *)imageByApplyAlpha:(CGFloat)alpha;



/**
 *  CoreImage图片高斯模糊
 *
 *  @param image 图片
 *  @param blur  模糊数值(默认是10)
 *
 *  @return 重新绘制的新图片
 */

+ (UIImage *)coreBlurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;
/**
 *  vImage模糊图片
 *
 *  @param image 原始图片
 *  @param blur  模糊数值(0-1)
 *
 *  @return 重新绘制的新图片
 */
+ (UIImage *)boxblurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;

/// 修改图片的大小
/// @param image image description
/// @param newSize 要变成的大小
+ (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize;

/// 压缩图片
/// @param image image description
/// @param maxLength maxLength description
+ (UIImage *)compressImageQuality:(UIImage *)image toByte:(NSInteger)maxLength;

/// 压缩图片 先质量压缩，后大小压缩
/// @param image image description
/// @param maxLength maxLength 图片大小 字节
+ (void)compressImage:(UIImage *)image toByte:(NSInteger)maxLength completion:(void(^)(UIImage *image, NSData *data, CGFloat compression))completion;

@end

NS_ASSUME_NONNULL_END
